package com.kangfawei.io;

import java.io.File;
import java.io.IOException;

public class FileTest {

    public static void main(String[] args) {
//        String path = "E:/IO_src/test01.txt";
//        File file = new File(path);
//        System.out.println(file.getPath());
//        System.out.println(file.getAbsolutePath());
//
//        String suffix = path.substring(path.lastIndexOf(".")+1);
//        System.out.println(suffix);
//
//        String[] strs = path.split("/");
//        System.out.println(strs[strs.length-1]);
        String src = "E:/IO_src/test01.txt";
        String targetDir = "E:/IO_target/";
        String path = "E:/IO_target/test.txt";
        FileSplit split = new FileSplit(src,targetDir,20);
        try {
            split.splitFile();
        } catch (IOException e) {
            e.printStackTrace();
        }

        try {
            split.mergeFile2(path);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
